
<style>
option{ font-family:微软雅黑}
.sty{display: inline-block;   margin-bottom: 10px;padding: 5px 6px;background: #563f01;color: #fff; border-radius: 5px;font-family:微软雅黑}

</style>
<script>
function sub_save(){
	
	$("#myform2").submit();
	}
</script>
 <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head1 clear">
			 <div class="account sprite_icon" style="text-align:center; ">
                  <a href="index.php?g=Mobile&m=User&a=index" style=" color:#FFF; line-height:50px">
                 {if cookie('username')}
                  {php $user=M('User')->field('username')->where('id='.$jgsatuserid)->find()}
                  {php echo $user['username']} 
                 {else}登录
                 {/if}
                 </a>
			 </div>
			 {if $title}
			    <div class="title">{$title}</div> 
               {else}
                <div class="title">{$seo_title}</div> 
               {/if}<div class="search sprite_icon">
			     <span class="keep" onclick="sub_save()">确定</span>
			 </div>
		 </div>
	 </div>	  
 <include file="Mobile:nav"/>            
<form method='post'  id="myform2" action="{:URL('Mobile-Designer/save')}">
   <input type="hidden" name="id"  value="{$list.id}"/>
 <div class="S_upload">
		 <div class="P_text Padding margin_top">
			 <strong>标题：</strong>
			 <input type="text" name="title"   value="{$list['title']}" class="tet"/>
			 <em></em>
		 </div>
		 <div class="P_text Padding">
			 <strong>描述：</strong>
			 <input type="text" name="describe"  value="{$list.describe}" class="tet"/>
			 <em></em>
		 </div>
		 <div class="P_text Padding">
			 <strong>类型：</strong>
			 <select name="itemType" id="name3" >
                    <option value="">请选择</option>
                        <YP:list name="Label" where="genre=17" id="r" limit="50">
                             <?php $seled = $list['itemType'] == $r['id'] ? 'selected="selected"' : '';?>
                    <option value="{$r['id']}" {$seled}>{$r['title']}</option>
                        </YP:list>
                </select>
			 <em></em>
		 </div>
		 <div class="P_text Padding">
			 <strong>造价：</strong>
			 <input type="text" name="budget"  value="{$list.budget}" class="tet"/>万/元
			 <em></em>
		 </div>
		 <div class="P_text Padding">
			 <strong>风格：</strong>
			 <select name="style" id="name4" >
                    <option value="">请选择</option>
                        <YP:list name="Label" where="genre=21" id="r" limit="50">
                             <?php $seled = $list['style'] == $r['id'] ? 'selected="selected"' : '';?>
                    <option value="{$r['id']}" {$seled}>{$r['title']}</option>
                        </YP:list>
                 </select>
			 <em></em>
		 </div>
		 <div class="P_text Padding">
			 <strong>面积：</strong>
			 <input type="text" name="itemArea"  value="{$list.itemArea}" class="tet"/>㎡
			 <em></em>
		 </div>
		 <div class="P_text Padding">
			 <strong>设计理论：</strong>
			 <input type="text"  name="content" class="tet" value="{$list.content}"/>
			 <em></em>
		 </div>
	 </div>

	 <div class="P_upload Padding clear">
		 <div class="left">
			 <div class="pic">
				 <img id="thumb_pic" src="{$list.pic}" alt="" />
			 </div>
		 </div>
<input type="hidden" id="thumb"  name="pic" value="{$list.pic}" class="input-text" />
		 <div class="right">
			 <div class="demo">
                <a class="btn" id="btn">上传首页推荐图</a> 
                <ul id="ul_pic" class="ul_pics clearfix"></ul>
            </div>
			 <br/>
			 <span>(建议尺寸为367*220)</span>
		 </div>
	 </div>

	 <div class="P_upload Padding clear">
		 <div class="left">
			 <div class="pic">
				 <img id="shejitu" src="{$list.thumb_list}" alt="" />
			 </div>
		 </div>
<input type="hidden" id="thumb_list"  name="thumb_list" value="{$list.thumb_list}" class="input-text" />
		 <div class="right">
			 <div class="demo">
                <a class="btn2" id="btn2">上传缩略图</a> 
                <ul id="ul_shejitu" class="ul_pics clearfix"></ul>
            </div>
			 <br/>
			 <span>(建议尺寸为908*425)</span>
		 </div>
	 </div>
      <div class="demo" style="text-align:center; margin-top:10px;">
                <a class="sty"  class="btn3" id="btn3">批量上传设计图</a> 
                <ul id="ul_pics" class="ul_pics clearfix"></ul>
            </div>
            <volist name="pics" id="v">
             <input class="input-text" id="pl_pics" type="hidden" value="{$v}" name="pics[]" size="50">
             </volist>
       <div class="demo" style="text-align:center">
                
               
            </div>     
    <form>
      
        <script type="text/javascript" src="../Public/upload/plupload/plupload.full.min.js"></script>
        
        <script type="text/javascript">
		$( function(){
            var uploader = new plupload.Uploader({ //创建实例的构造方法
                runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
                browse_button: 'btn', // 上传按钮
                url: "index.php?g=Mobile&m=Upload&a=index", //远程上传地址
                flash_swf_url: '../Public/upload/plupload/Moxie.swf', //flash文件地址
                silverlight_xap_url: '../Public/upload/plupload/Moxie.xap', //silverlight文件地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        if ($("#ul_pic").children("li").length > 30) {
                            alert("您上传的图片太多了！");
                            uploader.destroy();
                        } else {
                            var li = '';
                            plupload.each(files, function(file) { //遍历文件
                                li += "<li id='" + file['id'] + "'><div class='progress'><span class='bar'></span><span class='percent'>0%</span></div></li>";
                            });
                            $("#ul_pic").append(li);
                            uploader.start();
                        }
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条
                 var percent = file.percent;
                        $("#" + file.id).find('.bar').css({"width": percent + "%"});
                        $("#" + file.id).find(".percent").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
					
                       var data = eval("(" + info.response + ")");
					  // alert(data.name)
                        //$("#" + file.id).html("<div class='img'><img src='" + data.pic + "'/></div><p>" + data.name + "</p>");
						document.getElementById("thumb_pic").src=data.pic;
						$("#thumb").val(data.pic);
                    },
                    Error: function(up, err) { //上传出错的时候触发
					if(err.message=='File size error.'){
						err.message='图片大小超过限制';
						};
                        alert(err.message);
                    }
                }
            });
			 uploader.init();
			})
			 
			//上传缩略图
			$( function(){
			  var uploader = new plupload.Uploader({ //创建实例的构造方法
                runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
                browse_button: 'btn2', // 上传按钮
                url: "index.php?g=Mobile&m=Upload&a=index", //远程上传地址
                flash_swf_url: '../Public/upload/plupload/Moxie.swf', //flash文件地址
                silverlight_xap_url: '../Public/upload/plupload/Moxie.xap', //silverlight文件地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif"}
                    ]
                },
                multi_selection: false, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        if ($("#ul_shejitu").children("li").length > 30) {
                            alert("您上传的图片太多了！");
                            uploader.destroy();
                        } else {
                            var li = '';
                            plupload.each(files, function(file) { //遍历文件
                                li += "<li id='" + file['id'] + "'><div class='progress'><span class='bar'></span><span class='percent'>0%</span></div></li>";
                            });
                            $("#ul_shejitu").append(li);
                            uploader.start();
                        }
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条
                 var percent = file.percent;
                        $("#" + file.id).find('.bar').css({"width": percent + "%"});
                        $("#" + file.id).find(".percent").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                       var data = eval("(" + info.response + ")");
                        //$("#" + file.id).html("<div class='img'><img src='" + data.pic + "'/></div><p>" + data.name + "</p>");
						document.getElementById("shejitu").src=data.pic;
						$("#thumb_list").val(data.pic);
                    },
                    Error: function(up, err) { //上传出错的时候触发
					    if(err.message=='File size error.'){
						err.message='图片大小超过限制';
						};
                        alert(err.message);
                    }
                }
            });
			 uploader.init();
		})
			
 
        //批量上传设计图
		$( function(){
			  var uploader = new plupload.Uploader({ //创建实例的构造方法
                runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
                browse_button: 'btn3', // 上传按钮
                url: "index.php?g=Mobile&m=Upload&a=index", //远程上传地址
                flash_swf_url: '../Public/upload/plupload/Moxie.swf', //flash文件地址
                silverlight_xap_url: '../Public/upload/plupload/Moxie.xap', //silverlight文件地址
                filters: {
                    max_file_size: '10mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                    mime_types: [//允许文件上传类型
                        {title: "files", extensions: "jpg,png,gif"}
                    ]
                },
                multi_selection: true, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        if ($("#ul_pics").children("li").length > 30) {
                            alert("您上传的图片太多了！");
                            uploader.destroy();
                        } else {
                            var li = '';
                            plupload.each(files, function(file) { //遍历文件
                                li += "<li id='" + file['id'] + "'><div class='progress'><span class='bar'></span><span class='percent'>0%</span></div></li>";
                            });
                            $("#ul_pics").append(li);
                            uploader.start();
                        }
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条
                 var percent = file.percent;
                        $("#" + file.id).find('.bar').css({"width": percent + "%"});
                        $("#" + file.id).find(".percent").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                       var data = eval("(" + info.response + ")");
                        //$("#" + file.id).html("<div class='img'><img src='" + data.pic + "'/></div><p>" + data.name + "</p>");
						$("#ul_pics").append('<input  name="pics[]"class="input-text" type="hidden" value="'+ data.pic +'" name="pics[]" size="50">');
						
                    },
                    Error: function(up, err) { //上传出错的时候触发
						if(err.message=='File size error.'){
							err.message='图片大小超过限制';
							};
                        alert(err.message);
                    }
                }
            });
			
            uploader.init();
		})
     </script>   